This invention relates to a power management technology, particularly to a method for changing an operating speed or operating frequency of a processor.
There are many technologies to reduce power consumption by slowing down an operating speed of a processor. For instance, Japanese Published Unexamined Patent Application No. Hei 9-237132 discloses that the clock frequency is changed according to the load status of a CPU, remaining battery, and heating temperature status of the CPU, and the clock frequency is set to a proper value in accordance with such situation of the system. The load status of the CPU in the foregoing publication is determined by a driver software attached to an OS based upon how many times the CPU goes into an idle state during a certain period. That is, a flag showing a busy state is set every time the CPU accesses I/O or memory, a system controller detects the load status of the CPU by recognizing the frequency of the idle state based on the frequency of the setting of the flag.
In addition, Japanese Published Unexamined Patent Application No. Hei 9-22317 (a counterpart application of U.S. patent application Ser. No. 395,335, filed on Feb. 28, 1995) discloses a real time power-saving and heat controlling unit for a portable computer, wherein a monitor supervises whether a CPU can pause according to an activity of the CPU and a real time sample of a temperature level. In that application, a hardware selector reduces clocked time of the CPU if the CPU can pause, and returns the CPU to a previous high-speed clock level if the CPU is active. The monitor adjusts a performance level of the computer, and implements the power saving and the temperature control in response to the CPU activity and the real time sampling of temperature.
Also, Japanese Unexamined Patent Publication No. Hei 9-305569 (a counterpart application of U.S. patent application Ser. No. 010,135, filed on Jan. 17, 1996) discloses that, to dynamically perform power saving and power management by detecting dynamic operating characteristics of a CPU of a portable computer and estimating its activity level, at least one dynamic CPU operating characteristic is detected while the CPU is operating in a first and it is determined whether the CPU operating characteristic establishes a predetermined relationship to a predetermined set point related to the characteristic (whether there exists a set point interrupt condition) so that the first clock is changed to adjust the predetermined set point if there exists the set point interrupt condition. It also discloses that the decision of whether or not the CPU enters a calcuLation-oriented mode with little I/O is made by counting the number of instructions and deciding their types.
However, the background art does not disclose all of the algorithms to control operating speed of a processor by referring to an index related to a computer""s performance (referred to as xe2x80x9cperformance indexxe2x80x9d) and an index related to a power consumption (referred to as xe2x80x9cpower consumption indexxe2x80x9d). Also, it does not disclose any algorithm for controlling an operating speed of a processor, which refers to an energy index represented by a ratio of values of the power consumption index and the performance index.
Accordingly, an object of the present invention is to provide a new method to control the operating speed of a processor by referring to a performance index. It may also refer to a power consumption index in addition to the performance index.
It is also an object to provide a method to control the operating speed of a processor, which refers to an energy index.
Yet another object is to provide a method for controlling the operating speed of a processor, which uses the number of instructions in a user mode executed by the processor per a unit period as a performance index.
Furthermore, it is also an object to provide a method for controlling the operating speed of a processor, which uses the total number of instructions executed by the processor per a unit period as a performance index.
A first aspect of the present invention is a method for controlling the operating speed of a processor in a computer. This method includes the steps of: measuring a value of a first performance index during a first predetermined period; changing the operating speed of the processor; measuring a value of a second performance index during a second predetermined period; and by referring to values of the first and second performance indexes, changing the operating speed of the processor. Thus, by measuring a value of the performance index before and after a change of operating speed and using the results of measuring, it is possible to change the operating speed of a processor according to a changing trend of the performance index, for instance, to increase performance as much as possible under a predetermined condition. Meanwhile, the operating speed has almost the same meaning as that of an operating frequency. If an actual frequency cannot be controlled, an operating period and a non-operating period are set so that substantial operating speed or a substantial operating frequency is changed by controlling the ratio of them.
It is also possible to include the steps of: measuring a value of a power consumption index during a third predetermined period, and changing the operating speed of the processor based on a value of the power consumption index. For instance, it is also possible to set the operating frequency by a value of a power consumption index.
A second aspect of the present invention comprises the steps of: measuring values of a performance index and a power consumption index; by referring to a ratio of values of the performance and the power consumption indexes, changing a policy for changing the operating speed of a processor; and by referring to the policy, changing the operating speed of the processor. This is to change an operating speed of the processor by using the aforementioned energy index or its reciprocal. The policy change may be, for instance, at a case of performing the process of changing an operating speed all over again in the event of a high rate of change of the energy index or a case where a reciprocal of the energy index is segmented by a predetermined value and the process of changing an operating speed defined for each segment is performed.
Furthermore, a third aspect of the present invention comprises the steps of: measuring values of a performance and a power consumption indexes; calculating a value of an energy index from values of the performance and the power consumption indexes; and changing the operating speed of a processor to reduce a value of the energy index. Reducing the energy index means more power saving and higher performance (less sacrificed performance), which leads to more efficient power management.
Moreover, a fourth aspect of the present invention, which uses the number of executed instructions in a user mode by the processor, comprises the steps of: counting the number of executed instructions (Iu) in a user mode during a first predetermined period; and, by referring to the Iu, changing operating speed of the processor. The number of executed instructions in a user mode is an example of a performance index, and if a larger number of instructions in a user mode are executed, task performance becomes higher from a user""s viewpoint. Accordingly, an operating frequency is changed to increase the number of executed instructions in a user mode. Even if an operating frequency is raised, however, the number of executed instructions in a user mode does not always increase accordingly.
After performing the above changing step, the Iu may be counted again and the changing step may be performed again. By doing so, effect of a change of an operating speed can be fed back.
The invention may also comprise the steps of: counting the number of executed instructions (Iu2)in a user mode during a second predetermined period; and if a rate of change from Iu to Iu2 is higher than a predetermined value, setting an operating speed of the processor to a predetermined value. By doing so, a change of the type of a task being executed by the processor is detected.
It may also further comprise a step of counting the total number of executed instructions (It) during the second predetermined period. The total number of executed instructions is one of the power consumption indexes and it is possible to control an operating speed by using this count value. There may be a case where the number of executed instructions in a user mode is relatively small compared with the total number of executed instructions. In this case, a user task is not so much executed, so there is a room for change of operating speed in terms of task performance from a user""s viewpoint.
Accordingly, it is also possible to make the first and the second predetermined periods the same and execute a step of switching a change control mode or a change control flow of an operating speed by referring to a ratio of It and Iu. For instance, it is also possible to divide a user instruction oriented mode and a system instruction oriented mode by the ratio of It and Iu, or switch a change control flow by a rate of change of the ratio of It and Iu.
It is also possible to change operating frequency by the ratio of It and Iu and recount It and Iu in a changed state to feed back an effect of change of operating frequency.
The invention may also comprise the steps of counting the number of executed instructions (Iu) in a user mode during a predetermined period; counting the total number of executed instructions (It) during the predetermined period; and by referring to the ratio of It and Iu, changing the operating speed of the processor. In that case it may also comprise the steps of switching a policy for changing the operating speed; and by referring to the policy, changing the operating speed of the processor.